<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="nav" content="0" />
<meta name="acc" content="check-1" />
<title>日常监督</title>
<script type="text/javascript" charset="utf-8"
	src="<c:url value='/KindEditor/kindeditor.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/global.js'/>"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#flowCode").focus();
		$("#checkDate").addClass("Wate").bind("click", function() {
			WdatePicker({
				skin : 'whyGreen',
				minDate : '#F{$dp.$D(\'checkDate\')}',
				dateFmt : 'yyyy-MM-dd'
			});
		});
		
		$("#checkEndDate").addClass("Wate").bind("click", function() {
			WdatePicker({
				skin : 'whyGreen',
				minDate : '#F{$dp.$D(\'checkDate\')}',
				dateFmt : 'yyyy-MM-dd'
			});
		});
		
		$("#inputForm").validate({
			event : "blur",
			isTip : true
		});
		
		$("#next").click(function (){
			var projectId = $("#projectId").val();
			var type = $("#checkType").val();
			var checkDate = $("#checkDate").val();
			var checkEndDate = $("#checkEndDate").val();
			var projectId = $("input[name='projectId']").val();
			var checkId = "";
			$.post("${ctx }/quality/check!next.action",{projectId:projectId,checkType:type,checkDate:checkDate,checkEndDate:checkEndDate},
					function(data){
				checkId = data;
				$(window.parent.saveCheck(checkId,projectId));
				$(window.parent.close());
	    	})
			//$("#inputForm").attr("action","${ctx }/quality/check!next.action");
			//$("#inputForm").submit();
		});
	});
	
	function closeeds(){
		$(window.parent.close());
	}
</script>
</head>
<body>
	<form action="${ctx }/quality/check!next.action" method="post"
		id="inputForm" class="yform" enctype="multipart/form-data">
		<div id="caption">
			<h6>${licenseplateNumber}编制监督检查情况汇报</h6>
		</div>
		<input type="hidden" name="id" id="id" value="${id }"> <input
			type="hidden" name="projectId" id="projectId"
			value="${empty param.projectId ? projectId : param.projectId }">
		<input type="hidden" name="checkType" id="checkType"
			value="${empty param.checkType ? checkType : param.checkType }">
		<div>
			<table class="noborder">
				<tr class="type-text">
					<td>工程名称</td>
					<td><pt:labels type="proj"
							argument1="${empty param.projectId ? projectId : param.projectId }"
							single="true"></pt:labels></td>
				</tr>
				<c:if test="${param.checkType !='1'}">
				<tr class="type-text">
					<td>检查开始时间</td>
					<td><input type="text" name="checkDate" id="checkDate"
						value="${checkDate }" class="required"></td>
				</tr>
				<tr class="type-text">
					<td>检查结束时间</td>
					<td><input type="text" name="checkEndDate" id="checkEndDate"
						value="${checkEndDate }" class="required"></td>
				</tr>
				</c:if>
				<c:if test="${param.checkType =='1'}">
				<tr class="type-text">
					<td>检查时间</td>
					<td><input type="text" name="checkDate" id="checkDate"
						value="${checkDate }" class="required"></td>
				</tr>
				</c:if>
			</table>
		</div>
		<div class="type-button">
			<input type="button" class="submit" value="下一步" id="next" name="next"/> <input
				type="button" value="关闭" class="reset" onclick="closeeds();" />
		</div>
	</form>
</body>
</html>